from django.db import models

# Create your models here.
class User(models.Model):
    id = models.AutoField("id",primary_key=True)
    username = models.CharField("username",max_length=255,default='')
    password = models.CharField("password",max_length=255,default='')
    createTime = models.DateField("创建时间",auto_now_add=True)

    class Meta:
        db_table = 'user'

class History(models.Model):
    id = models.AutoField("id", primary_key=True)
    jobId = models.CharField("职位ID",max_length=255,default='')
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    count = models.IntegerField("收藏次数",default=1)

    class Meta:
        db_table = 'history'

class UserBehavior(models.Model):
    id = models.AutoField("id", primary_key=True)  # 对应数据的唯一标识，可根据实际情况调整类型
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    behavior_type = models.CharField(max_length=50)
    behavior_count = models.IntegerField(null=True, blank=True)  # 点击率，可为空

    class Meta:
        db_table = 'user_behavior'